package com.cc.infrastructure.special.impl;

import com.cc.infrastructure.special.dto.UserAllTypeDo;
import com.sccin.components.jpa.entiy.ParamConditionBO;
import com.sccin.components.jpa.entiy.type.ConditionEnum;
import com.sccin.components.query.AutoPageJpa;
import com.sccin.components.utils.auto.AutoUtil;
import com.sccin.components.utils.auto.parseParamCondition.RequirParametersAndConditions;
import org.springframework.data.domain.Page;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

public class $ {
  classNameForDaoImpl
} implements UserAllTypeDao{
@PersistenceContext
private EntityManager entityManager;

@Override
public Page<UserAllTypeDo> query(String name,int pageNum,int pageSize){
  AutoPageJpa<UserAllTypeDo> autoPageJpa=new AutoPageJpa<>(UserAllTypeDo.class);
  StringBuilder select=new StringBuilder("${selectSql}");
  StringBuilder from=new StringBuilder("${fromSql}");

  RequirParametersAndConditions<ParamConditionBO, Object> where=RequirParametersAndConditions.getInstance();
  where
  return autoPageJpa.autopage(select,null,from,where,null,AutoUtil.initPageable(pageNum,pageSize),entityManager);
  }
  }